import request from '@/utils/request'

// 会议卡片数据
export interface MeetCard {
  id: number
  name: string
  time: string
  url: string
}

// 活动卡片数据
export interface ActivityCard {
  id: number
  name: string
  time: string
  url: string
}

// 展品卡片数据
export interface ExhibitCard {
  id: number | string
  name: string
  imageUrl?: string
  videoUrl?: string
  del?: any
}

// 企业展示网格数据
export interface GridItem {
  id: number | string
  name: string
  imageUrl?: string
  videoUrl?: string
  del?: any
}

// 地理位置数据
export interface GeoData {
  [key: string]: number
}

// 时间趋势数据
export interface TimeData {
  [key: string]: {
    all: number
    signed: number
  }
}

// 获取参会人员总数量
export const getAllParticipants = () => {
  return request.get<number>('/api/home/all')
}

// 获取已签到人员总数量
export const getSignedParticipants = () => {
  return request.get<number>('/api/home/signed')
}

// 获取会议卡片列表
export const getMeetCards = () => {
  return request.get<MeetCard[]>('/api/home/meet_card')
}

// 获取活动卡片列表
export const getActivityCards = () => {
  return request.get<ActivityCard[]>('/api/home/activity_card')
}

// 获取展品卡片列表
export const getExhibitCards = () => {
  return request.get<ExhibitCard[]>('/api/home/exhibit_card')
}

// 获取企业展示网格数据
export const getGridData = () => {
  return request.get<any,GridItem[]>('/api/home/grid')
}

// 获取地理位置统计数据
export const getGeoData = () => {
  return request.get<any,GeoData>('/api/home/geo')
}

// 获取时间趋势数据
export const getTimeData = () => {
  return request.get<any,TimeData>('/api/home/time')
} 